package com.zgm.ch06.aop.xml.introduce._3_4;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

import com.zgm.ch06.aop.aspectJ.introduce._2_7.interfaces.CallTracker;
import com.zgm.ch06.aop.common.User;

public class AspectBean {

	/*public void logCall(JoinPoint jp) {
		System.out.println("方面生效了");
		System.out.println(jp);
	}*/
	
	/*public void auditCall(Object target, Object ret) {
		System.out.println("后直通知执行了");

		if(ret instanceof User) {
			((User) ret).setPassword("***");
		}
	}*/
	
	/*public void healthMonitoring(Object target, NullPointerException ex) {
		System.out.println("目标target " + target + " 抛出了一个异常：" + ex);
	}*/
	
	/*public void after(Object target) {
		System.out.println("最终通知执行了，target=" + target);
	}*/
	
	/*public void censorStringArguments(ProceedingJoinPoint pjp, String argument) {
		System.out.println("包围通知执行了，argument=" + argument);
	}*/
	
	public void normalCall(CallTracker tracker) {
		System.out.println("后知通知执行了");
		tracker.markNormal();
	}
	
	public void failingCall(CallTracker tracker) {
		System.out.println("抛出后通知执行了");
		tracker.markFailing();
	}
}
